package shop.services.front.sku.dao.impl;

import org.springframework.stereotype.Repository;
import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.front.sku.bean.Sku;
import shop.services.front.sku.dao.SkuDao;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/4/24.
 */
@Repository("skuDaoFront")
public class SkuDaoImpl implements SkuDao {
    @Resource
    private BaseDao dao;
    public void setDao(BaseDao dao){this.dao=dao;}

    public SkuDaoImpl() {
        super();
    }

    @Override
    public int insert(Sku sku) {
        return 0;
    }

    @Override
    public int delete(Sku sku) {
        return 0;
    }

    @Override
    public int update(Sku sku) {
        dao.update("front.sku.update",sku);
        return 0;
    }

    @Override
    public Sku selectOne(Sku sku) {
        return (Sku) dao.selectOne("front.sku.selectOne", sku);
    }

    @Override
    public PagerModel selectPageList(Sku sku) {
        return null;
    }

    @Override
    public List<Sku> selectList(Sku sku) {
        return null;
    }

    @Override
    public int deleteById(int id) {
        return 0;
    }

    @Override
    public Sku selectById(String id) {
        return null;
    }

    @Override
    public List<Sku> selectListByProductId(Sku sku) {
        return (List<Sku>) dao.selectList("front.sku.selectListByProduceId", sku);
    }

    @Override
    public List<Sku> selectListBySpecID(Sku sku) {
        return (List<Sku>) dao.selectList("front.sku.selectListBySpecID",sku);
    }
}
